(:
XQuery that gets elements from xsd
:)

declare namespace ns = "http://www.w3.org/2001/XMLSchema";
<xsd-elements>{
let $doc := doc("xsd.xsd")

for $elements in $doc//ns:element
let $name := $elements/@name
return
   <element name="{$name}"></element>
}</xsd-elements>